import { services } from '@/config'

export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  labelPosition: 'left',
  labelSuffix: ':',
  labelWidth: 120,
  gutter: 0,
  menuBtn: true,
  submitBtn: true,
  submitText: '提交',
  emptyBtn: true,
  viewBtn: true,
  emptyText: '清空',
  menuPosition: 'center',
  searchMenuSpan: 12,
  column: [
    {
      type: 'number',
      label: '所属年度',
      prop: 'year',
      span: 12,
      max: 9999,
      search: true,
      required: true,
      rules: [{ required: true, message: '所属年度必须填写' }]
    },
    {
      prop: 'unid',
      span: 12,
      type: 'input',
      label: '唯一编码',
      rules: [],
      display: false,
      required: false,
      hide: true,
      value: ''
    },
    {
      type: 'input',
      label: '预算序号',
      prop: 'number',
      span: 12,
      rules: [{ required: true, message: '所属年度必须填写' }],
      required: true,
      search: true
    },
    {
      type: 'select',
      label: '预算分类',
      prop: 'type',
      span: 12,
      rules: [{ required: true, message: '预算分类必须填写' }],
      required: true,
      search: true,
      cascaderItem: [],
      display: true,
      props: { label: 'label', value: 'value' },
      dicUrl: `${services.adminService}dict/type/budget_type`,
      dicMethod: 'get'
    },
    {
      type: 'tree',
      label: '开支单位',
      prop: 'expenditureId',
      span: 12,
      rules: [{ required: true, message: '开支单位名称必须填写' }],
      required: true,
      search: true,
      display: true,
      width: 160,
      parent: true,
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.adminService}dept/tree`,
      dicMethod: 'get'
    },
    {
      type: 'tree',
      label: '执行单位',
      prop: 'executionId',
      width: 160,
      span: 12,
      rules: [{ required: true, message: '执行单位名称必须填写' }],
      required: true,
      search: true,
      display: true,
      parent: true,
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.adminService}dept/tree`,
      dicMethod: 'get'
    },
    {
      type: 'tree',
      label: '责任人',
      prop: 'liableId',
      span: 12,
      required: true,
      rules: [{ required: true, message: '责任人必须填写' }],
      search: true,
      display: true,
      width: 120,
      parent: true,
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.adminService}user/tree`,
      dicMethod: 'get'
    },
    {
      type: 'input',
      label: '预算金额',
      prop: 'amount',
      span: 12,
      required: true,
      value: '0.00'
    },
    {
      type: 'date',
      label: '完成时间',
      prop: 'completionDate',
      span: 12,
      display: true,
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      search: true,
      width: 100
    },
    {
      type: 'radio',
      label: '限制合同执行',
      dicData: [
        { label: '否', value: '0' },
        { label: '是', value: '1' }
      ],
      span: 24,
      display: true,
      props: { label: 'label', value: 'value' },
      prop: 'limitThreshold',
      value: '0',
      width: 110
    },
    { type: 'textarea', label: '备注', prop: 'remarks', span: 24, width: 200, display: true },
    {
      label: '附件信息',
      prop: 'uploadPage',
      type: 'input',
      formslot: true,
      slot: true,
      span: 24,
      hide: true
    }
  ]
}
